<?php

/**
 * author : Tran Minh Toan
 */

class Application_Form_Warranty extends Zend_Form{
    
    public function init(){
        $this->setName('Warranty');
        //$this->setMethod('post');
        //$product = new Application_Form_Product();
        
        $warranty_id = new Zend_Form_Element_Hidden('warranty_id');
        $warranty_date_create = new Zend_Form_Element_Hidden('warranty_date_create');
        $user_id_employee = new Zend_Form_Element_Hidden('user_id_employee');
        
        
        $product_id = new Zend_Form_Element_Text('product_id');
                $product_id->setLabel('ID sản phẩm : ')
                    ->setRequired(true)
                    ->addValidator('NotEmpty');
            
        
        $user_id_customer = new Zend_Form_Element_Text('user_id_customer');
                $user_id_customer->setLabel('ID khách hàng : ')
                                 ->setRequired(true)
                ->addFilters(array('StripTags', 'StringTrim', 'Int'))
                ->addValidator('NotEmpty');
                
        
        /*$isReturned = new Zend_Form_Element_Text('IsReturned');
                $isReturned->setLabel('Tình trạng trả hàng : ')
                                 ->setRequired(true)
                ->addFilters(array('StripTags', 'StringTrim', 'Int'))
                ->addValidator('NotEmpty');*/
        
                
        $isReturned = new Zend_Form_Element_Select('isReturned');
            $isReturned->setLabel('Tình trạng trả hàng : ')
                    ->setRequired(true);
            $isReturned->addMultiOptions(array(
                '1' => "Đã trả",
                '0' => "Chưa trả"
            ));
            
            
            
        $btn_submit = new Zend_Form_Element_Submit('submit');
        $btn_submit->setAttrib('id', 'submit');
        $btn_submit->setlabel('Đồng ý');

        $btn_cancel = new Zend_Form_Element_Submit('cancel');
        $btn_cancel->setAttrib('id', 'cancel');
        $btn_cancel->setLabel('Hủy bỏ');
        
        $this->addElements(array($warranty_id, $warranty_date_create, $user_id_employee, $product_id,
            $user_id_customer, $isReturned, $btn_submit, $btn_cancel));
           
    }
}
?>
